﻿using System;
using UnityEngine;

// Token: 0x02000418 RID: 1048
public class LogicCollidingSphere : MonoBehaviour
{
	// Token: 0x06001DBF RID: 7615 RVA: 0x000B69C3 File Offset: 0x000B4BC3
	private void Start()
	{
		this.nChunksDetached = 0;
		this.nChunkCollisions = 0;
	}

	// Token: 0x06001DC0 RID: 7616 RVA: 0x000B69D3 File Offset: 0x000B4BD3
	private void Update()
	{
		if (this.bDropped && this.ObjectToDrop.isKinematic)
		{
			this.ObjectToDrop.isKinematic = false;
			this.ObjectToDrop.WakeUp();
		}
	}

	// Token: 0x06001DC1 RID: 7617 RVA: 0x000B6A08 File Offset: 0x000B4C08
	private void OnGUI()
	{
		if (!LogicGlobalFracturing.HelpVisible)
		{
			return;
		}
		LogicGlobalFracturing.GlobalGUI();
		GUILayout.Label("This scene shows:", new GUILayoutOption[0]);
		GUILayout.Label("-Voronoi fracturing", new GUILayoutOption[0]);
		GUILayout.Label("-Fracturing on physical contact", new GUILayoutOption[0]);
		GUILayout.Label("-Collision custom notifications", new GUILayoutOption[0]);
		GUILayout.Label("-Collision particles", new GUILayoutOption[0]);
		GUILayout.Label("-Collision sounds", new GUILayoutOption[0]);
		GUILayout.Label(string.Empty, new GUILayoutOption[0]);
		GUILayout.Label("Press the button below to drop the object.", new GUILayoutOption[0]);
		if (GUILayout.Button("Drop", new GUILayoutOption[0]))
		{
			this.bDropped = true;
		}
		GUILayout.Label("Collision notifications:", new GUILayoutOption[0]);
		GUILayout.Label(this.nChunksDetached + " chunks detached", new GUILayoutOption[0]);
		GUILayout.Label(this.nChunkCollisions + " chunk collisions", new GUILayoutOption[0]);
	}

	// Token: 0x06001DC2 RID: 7618 RVA: 0x000B6B11 File Offset: 0x000B4D11
	private void OnChunkDetach(FracturedChunk.CollisionInfo info)
	{
		info.bCancelCollisionEvent = false;
		this.nChunksDetached++;
	}

	// Token: 0x06001DC3 RID: 7619 RVA: 0x000B6B28 File Offset: 0x000B4D28
	private void OnFreeChunkCollision(FracturedChunk.CollisionInfo info)
	{
		info.bCancelCollisionEvent = false;
		this.nChunkCollisions++;
	}

	// Token: 0x04001DDF RID: 7647
	public Rigidbody ObjectToDrop;

	// Token: 0x04001DE0 RID: 7648
	private bool bDropped;

	// Token: 0x04001DE1 RID: 7649
	private int nChunksDetached;

	// Token: 0x04001DE2 RID: 7650
	private int nChunkCollisions;
}
